<template>
  <div class="accountSetting">
    <section class="header clearfix">
      <span>账户设置</span>
    </section>
    <ul class="menu-swtich">
      <li
        v-for="(item, index) in menu"
        :key="index"
        :class="[editType == index ? 'active' : '']"
        @click="switchFun(index)"
      >
        {{ item.title }}
      </li>
    </ul>
    <div class="content" v-show="editType == 0">
      <div class="content-header clearfix">
        <div class="title">账户主体</div>
        <div class="edit" :hidden="isPlatformManager" @click="editAccountFun()">
          <i class="iconfont iconweibiaoti2010104"></i>
          编辑
        </div>
      </div>
      <div class="main-content">
        <section>
          <span class="st">公司名称</span>
          <span>{{ info.companyName }}</span>
        </section>
        <section>
          <span class="st">注册地址</span>
          <span>{{ info.address | addressFilter }}</span>
        </section>
        <section>
          <span class="st">营业执照号</span>
          <span>{{ info.businessNo ? info.businessNo : "暂无" }}</span>
        </section>
        <div class="up-img">
          <el-image
            v-if="info.businessImagePath"
            style="width: 100%; height: 100%"
            :src="info.businessImagePath"
            :preview-src-list="srcList"
          ></el-image>
          <div class="img-b" v-show="!info.businessImagePath">营业执照</div>
        </div>
        <div style="margin: 20px 0">
          <span class="st" style="margin:10px 0">缴纳项设置</span>
          <section>
            <el-checkbox-group v-model="infoChecks">
              <el-checkbox label="checkRetirement" border disabled size="mini">社保</el-checkbox>
              <el-checkbox label="checkMedical" border disabled size="mini">医保</el-checkbox>
              <el-checkbox label="checkFund" border disabled size="mini">公积金</el-checkbox>
              <el-checkbox label="checkWages" size="mini" disabled border>工资</el-checkbox>
              <el-checkbox label="checkContract" size="mini" disabled border>合同</el-checkbox>
            </el-checkbox-group>
          </section>
          <div v-if="changeCompanySettingDiv('checkRetirement')">
            <el-divider content-position="left" style="font-size: 8px;">社保(养老、失业、工伤、残保金)</el-divider>
            <el-descriptions direction="vertical" :column="4" size="mini" border>
              <el-descriptions-item label="社保基数" :span="2"><el-input v-model="infoCheck.retirementBase" readonly placeholder="输入社保基数" size="mini"><template slot="append">元</template></el-input></el-descriptions-item>
              <el-descriptions-item label="社保养老企业支付比例"><el-input v-model="infoCheck.companyRetirementRate" readonly placeholder="输入社保养老企业支付比例" size="mini"><template slot="append">%</template></el-input></el-descriptions-item>
              <el-descriptions-item label="社保养老个人支付比例" ><el-input v-model="infoCheck.personRetirementRate" readonly placeholder="输入社保养老个人支付比例" size="mini"><template slot="append">%</template></el-input></el-descriptions-item>

              <el-descriptions-item label="社保失业公司支付比例"><el-input v-model="infoCheck.companyUnemploymentRate" readonly placeholder="输入社保失业公司支付比例" size="mini"><template slot="append">%</template></el-input></el-descriptions-item>
              <el-descriptions-item label="社保失业个人支付比例"><el-input v-model="infoCheck.personUnemploymentRate" readonly placeholder="输入社保失业个人支付比例" size="mini"><template slot="append">%</template></el-input></el-descriptions-item>
              <el-descriptions-item label="社保工伤公司支付比例"><el-input v-model="infoCheck.companyNdustrialInjuryRate" readonly placeholder="输入社保工伤公司支付比例" size="mini"><template slot="append">%</template></el-input></el-descriptions-item>
              <el-descriptions-item label="社保残保金公司支付比例"><el-input v-model="infoCheck.companyDisabilityBenefitsRate" readonly placeholder="输入社保残保金公司支付比例" size="mini"><template slot="append">%</template></el-input></el-descriptions-item>
            </el-descriptions>
          </div>
          <div v-if="changeCompanySettingDiv('checkMedical')">
            <el-divider content-position="left" style="font-size: 8px;">医保</el-divider>
            <el-descriptions direction="vertical" :column="4" size="mini" border>
              <el-descriptions-item label="医保基数" :span="2"><el-input v-model="infoCheck.medicalBase" readonly placeholder="输入医保基数" size="mini"><template slot="append">元</template></el-input></el-descriptions-item>
              <el-descriptions-item label="医保企业支付比例"><el-input v-model="infoCheck.companyMedicalRate" readonly placeholder="输入医保企业支付比例" size="mini"><template slot="append">%</template></el-input></el-descriptions-item>
              <el-descriptions-item label="医保个人支付比例" ><el-input v-model="infoCheck.personMedicalRate" readonly placeholder="输入医保个人支付比例" size="mini"><template slot="append">%</template></el-input></el-descriptions-item>
            </el-descriptions>
          </div>
          <div v-if="changeCompanySettingDiv('checkFund')">
            <el-divider content-position="left" style="font-size: 8px;">公积金</el-divider>
            <el-descriptions direction="vertical" :column="4" size="mini" border>
              <el-descriptions-item label="公积金基数" :span="2"><el-input v-model="infoCheck.fundBase" readonly placeholder="输入公积金基数" size="mini"><template slot="append">元</template></el-input></el-descriptions-item>
              <el-descriptions-item label="公积金企业支付比例"><el-input v-model="infoCheck.companyFundRate" readonly placeholder="输入公积金企业支付比例" size="mini"><template slot="append">%</template></el-input></el-descriptions-item>
              <el-descriptions-item label="公积金个人支付比例" ><el-input v-model="infoCheck.personFundRate" readonly placeholder="输入公积金个人支付比例" size="mini"><template slot="append">%</template></el-input></el-descriptions-item>
            </el-descriptions>
          </div>
          <div v-if="changeCompanySettingDiv('checkWages')">
            <el-divider content-position="left" style="font-size: 8px;">工资</el-divider>
            <el-descriptions direction="vertical" :column="1" size="mini" border>
              <el-descriptions-item label="工资"><el-input v-model="infoCheck.wages" readonly placeholder="输入工资" size="mini"><template slot="append">元</template></el-input></el-descriptions-item>
            </el-descriptions>
          </div>
        </div>
      </div>
    </div>
    <div class="content" v-show="editType == 1">
      <div class="content-header clearfix">
        <div class="title">发票信息</div>
        <div class="edit" :hidden="isPlatformManager" @click="editInvoiceBtn()">
          <i class="iconfont iconweibiaoti2010104"></i>
          编辑
        </div>
      </div>
      <div class="main-content">
        <section>
          <span class="st">开票抬头</span>
          <span>{{ invoice.billingRise }}</span>
        </section>
        <section>
          <span class="st">纳税人识别号</span>
          <span>{{ invoice.taxpayerNo ? invoice.taxpayerNo : "--" }}</span>
        </section>
        <section>
          <span class="st">收票邮箱</span>
          <span>{{ invoice.collectEmail ? invoice.collectEmail : "--" }}</span>
        </section>
      </div>
    </div>
    <div class="content" v-show="editType == 2">
      <div class="content-header clearfix">
        <div class="title">联系人</div>
        <div class="edit" :hidden="isPlatformManager" @click="editContact()">
          <i class="iconfont iconweibiaoti2010104"></i>
          编辑
        </div>
      </div>
      <div class="main-content">
        <section>
          <span class="st">姓名</span>
          <span>{{ contact.contactName ? contact.contactName : "--" }}</span>
        </section>
        <section>
          <span class="st">岗位</span>
          <span>{{ contact.contactPost ? contact.contactPost : "--" }}</span>
        </section>
        <section>
          <span class="st">电子邮箱</span>
          <span>{{ contact.contactEmail ? contact.contactEmail : "--" }}</span>
        </section>
        <section>
          <span class="st">手机</span>
          <span>{{ contact.contactPhone ? contact.contactPhone : "--" }}</span>
        </section>
        <section>
          <span class="st">固定电话</span>
          <span>{{ contact.contactTel ? contact.contactTel : "--" }}</span>
        </section>
      </div>
    </div>
    <div class="content" v-show="editType == 3">
      <div class="content-header clearfix">
        <div class="title">邮寄地址</div>
        <div class="edit" @click="addAddress()">
          <i class="iconfont iconadd1"></i>
          添加
        </div>
      </div>
      <div class="main-content">
        <div
          class="address-list clearfix"
          v-for="(item, index) in addressInfo"
          :key="index"
        >
          <ul>
            <li>
              <div class="name">{{ item.fullName }}</div>
              <div class="phone">{{ item.phone }}</div>
              <div class="isDefault" v-if="item.isDefault == 1">默认</div>
            </li>
            <li>{{ item.address | addressFilter }}</li>
          </ul>
          <div
            class="address-edit"
            :hidden="isPlatformManager"
            @click="editAddress(index)"
          >
            <i class="iconfont iconweibiaoti2010104"></i>
            编辑
          </div>
          <div class="address-edit" @click="remove(item.mailId)">
            <i class="iconfont iconshanchu"></i>
            删除
          </div>
        </div>
        <p class="nodata" v-if="isAdd">还没有地址，请先添加</p>
      </div>
    </div>
    <div class="content" v-show="editType == 4">
      <div class="content-header clearfix">
        <div class="title">绑定手机</div>
      </div>
      <div class="main-content">
        <section>
          <span>绑定手机</span>
          <span>{{ safeBindPhone }}</span>
        </section>
        <section class="bind" @click="changePhone()">
          <i class="iconfont iconyunongtongqingshurushoujihaoma"></i>
          <span>变更号码</span>
        </section>
        <section class="bind" @click="changePassword()">
          <i class="iconfont iconmima1"></i>
          <span>修改密码</span>
        </section>
      </div>
    </div>
    <!-- <div class="content" v-show="editType == 5">
      <div class="content-header clearfix">
        <div class="title">余额管理</div>
        <div class="edit" v-if="isApply" @click="expenditureApply()">
          <i class="iconfont iconweibiaoti2010104"></i>
          支出申请
        </div>
      </div>
      <div class="main-content">
        <section>
          <span class="st">账户余额</span>
          <span><i class="sign">￥</i>{{ accountAmount | moneyFilters }}</span>
        </section>
      </div>
    </div> -->
    <!--上传图片-->
    <el-dialog
      title="上传营业执照"
      :visible.sync="updateDialog"
      :close-on-click-modal="false"
      :show-close="false"
      center
      width="600px"
    >
      <div class="img-head" v-loading="imgLoading">
        <i class="iconfont iconadd1"></i>
        <input
          type="file"
          name=""
          id=""
          accept="image/jpeg,image/jpg,image/png"
          @change="upImg($event)"
        />
      </div>
      <div slot="footer" class="dialog-footer"></div>
    </el-dialog>
    <!--账户信息-->
    <el-drawer
      title="变更账户主体信息"
      :visible.sync="infoDialog"
      :close-on-click-modal="false"
      :show-close="false"
      direction="rtl"
      size="70%"
      modal
      append-to-body
      :close-on-press-escape="false"
    >
      <div>
        <el-descriptions class="margin-top" :column="3" size="mini" border>
          <el-descriptions-item>
            <template slot="label">
              <i class="el-icon-office-building"></i>
              <i style="color: red">*</i>公司名称(必填)
            </template>
            <el-input
              v-model="editAccount.companyName"
              placeholder="请输入" size="mini"
            ></el-input>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">
              <i class="el-icon-position"></i>
              <i style="color: red">*</i>省市区(必填)
            </template>
            <el-cascader
              v-model="registerAddress"
              :options="addressList" size="mini"
            ></el-cascader>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">
              <i class="el-icon-location-outline"></i>
              <i style="color: red">*</i>详细地址(必填)
            </template>
            <el-input
              v-model="registAddress"
              placeholder="在这里输入详细地址"
              size="mini"
              clearable
            ></el-input>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">
              <i class="el-icon-tickets"></i>
              <i style="color: red">*</i>营业执照号(必填)
            </template>
            <el-input
              v-model="editAccount.businessNo"
              placeholder="在这里输入营业执照号"
              clearable
              size="mini"
            ></el-input>
          </el-descriptions-item>
          <el-descriptions-item :span="2">
            <template slot="label">
              <i class="el-icon-picture-outline"></i>
              营业执照
            </template>
            <div class="up-img">
              <el-image
                v-if="editAccount.businessImagePath"
                style="width: 100%; height: 100%"
                :src="editAccount.businessImagePath"
                :preview-src-list="srcList"
              ></el-image>
              <div class="img-b" v-show="!editAccount.businessImagePath">
                营业执照
              </div>
            </div>
            <section class="retransmission" @click="upimgFun">
              <span class="iconfont iconshangchuan"></span>
              <span>上传</span>
            </section>
          </el-descriptions-item>
          <el-descriptions-item :span="3">
            <template slot="label">
              <i class="el-icon-s-grid"></i>
              <i style="color: red">*</i>缴纳项设置(必填)
            </template>
            <section>
              <el-checkbox-group v-model="infoChecks" @change="changeCompanySetting">
                <el-checkbox label="checkRetirement" border  size="mini">社保</el-checkbox>
                <el-checkbox label="checkMedical" border size="mini">医保</el-checkbox>
                <el-checkbox label="checkFund" border  size="mini">公积金</el-checkbox>
                <el-checkbox label="checkWages" size="mini"  border>工资</el-checkbox>
                <el-checkbox label="checkContract" size="mini"  border>合同</el-checkbox>
              </el-checkbox-group>
            </section>

            <div v-if="changeCompanySettingDiv('checkRetirement')" :data-a="retirement">
              <el-divider content-position="left" style="font-size: 8px;">社保(养老、失业、工伤、残保金)</el-divider>
              <el-descriptions direction="vertical" :column="4" size="mini" border>
                <el-descriptions-item label="社保基数" :span="2"><el-input v-model="infoCheck.retirementBase" placeholder="输入社保基数" size="mini"><template slot="append">元</template></el-input></el-descriptions-item>
                <el-descriptions-item label="社保养老企业支付比例"><el-input v-model="infoCheck.companyRetirementRate" placeholder="输入社保养老企业支付比例" size="mini"><template slot="append">%</template></el-input></el-descriptions-item>
                <el-descriptions-item label="社保养老个人支付比例" ><el-input v-model="infoCheck.personRetirementRate" placeholder="输入社保养老个人支付比例" size="mini"><template slot="append">%</template></el-input></el-descriptions-item>

                <el-descriptions-item label="社保失业公司支付比例"><el-input v-model="infoCheck.companyUnemploymentRate" placeholder="输入社保失业公司支付比例" size="mini"><template slot="append">%</template></el-input></el-descriptions-item>
                <el-descriptions-item label="社保失业个人支付比例"><el-input v-model="infoCheck.personUnemploymentRate" placeholder="输入社保失业个人支付比例" size="mini"><template slot="append">%</template></el-input></el-descriptions-item>
                <el-descriptions-item label="社保工伤公司支付比例"><el-input v-model="infoCheck.companyNdustrialInjuryRate" placeholder="输入社保工伤公司支付比例" size="mini"><template slot="append">%</template></el-input></el-descriptions-item>
                <el-descriptions-item label="社保残保金公司支付比例"><el-input v-model="infoCheck.companyDisabilityBenefitsRate" placeholder="输入社保残保金公司支付比例" size="mini"><template slot="append">%</template></el-input></el-descriptions-item>
              </el-descriptions>
            </div>
            <div v-if="changeCompanySettingDiv('checkMedical')" :data-a="medical">
              <el-divider content-position="left" style="font-size: 8px;">医保</el-divider>
              <el-descriptions direction="vertical" :column="4" size="mini" border>
                <el-descriptions-item label="医保基数" :span="2"><el-input v-model="infoCheck.medicalBase" placeholder="输入医保基数" size="mini"><template slot="append">元</template></el-input></el-descriptions-item>
                <el-descriptions-item label="医保企业支付比例"><el-input v-model="infoCheck.companyMedicalRate" placeholder="输入医保企业支付比例" size="mini"><template slot="append">%</template></el-input></el-descriptions-item>
                <el-descriptions-item label="医保个人支付比例" ><el-input v-model="infoCheck.personMedicalRate"  placeholder="输入医保个人支付比例" size="mini"><template slot="append">%</template></el-input></el-descriptions-item>
              </el-descriptions>
            </div>
            <div v-if="changeCompanySettingDiv('checkFund')" :data-a="fund">
              <el-divider content-position="left" style="font-size: 8px;">公积金</el-divider>
              <el-descriptions direction="vertical" :column="4" size="mini" border>
                <el-descriptions-item label="公积金基数" :span="2"><el-input v-model="infoCheck.fundBase" placeholder="输入公积金基数" size="mini"><template slot="append">元</template></el-input></el-descriptions-item>
                <el-descriptions-item label="公积金企业支付比例"><el-input v-model="infoCheck.companyFundRate" placeholder="输入公积金企业支付比例" size="mini"><template slot="append">%</template></el-input></el-descriptions-item>
                <el-descriptions-item label="公积金个人支付比例" ><el-input v-model="infoCheck.personFundRate" placeholder="输入公积金个人支付比例" size="mini"><template slot="append">%</template></el-input></el-descriptions-item>
              </el-descriptions>
            </div>
            <div v-if="changeCompanySettingDiv('checkWages')" :data-a="wages">
              <el-divider content-position="left" style="font-size: 8px;">工资</el-divider>
              <el-descriptions direction="vertical" :column="1" size="mini" border>
                <el-descriptions-item label="工资"><el-input v-model="infoCheck.wages" placeholder="输入工资" size="mini"><template slot="append">元</template></el-input></el-descriptions-item>
              </el-descriptions>
            </div>

          </el-descriptions-item>
        </el-descriptions>

      </div>
      <div style="position: fixed;bottom: 5px;right: 10px;">
        <el-button
          @click="
            infoDialog = false;
            editLoading = false;
          "
          size="mini"
        >取 消</el-button
        >
        <el-button type="primary" :loading="editLoading" @click="saveAccount" size="mini"
        >确 定</el-button
        >
      </div>
    </el-drawer>
    <!--发票信息-->
    <el-dialog
      title="变更发票信息"
      :visible.sync="invoiceDialog"
      center
      width="600px"
      :close-on-click-modal="false"
      :show-close="false"
      @close="invoiceClose"
    >
      <el-form :model="editInvoice">
        <el-form-item label="开票抬头(必填)" required>
          <el-input
            v-model="editInvoice.billingRise"
            placeholder="在这里输入开票抬头"
            clearable
          ></el-input>
        </el-form-item>
        <el-form-item label="纳税人识别号(必填)" required>
          <el-input
            v-model="editInvoice.taxpayerNo"
            placeholder="在这里输入纳税人识别号"
            clearable
          ></el-input>
        </el-form-item>
        <el-form-item label="收票邮箱(选填)">
          <el-input
            v-model="editInvoice.collectEmail"
            placeholder="在这里输入收票邮箱"
            clearable
          ></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="editLoading">取 消</el-button>
        <el-button type="primary" :loading="editLoading" @click="saveInvoice"
          >确 定</el-button
        >
      </div>
    </el-dialog>
    <!--联系人-->
    <el-dialog
      title="变更联系人"
      :visible.sync="contactsDialog"
      :close-on-click-modal="false"
      :show-close="false"
      center
      width="600px"
    >
      <el-form :model="contacts">
        <el-form-item label="姓名(必填)" required>
          <el-input
            v-model="contacts.contactName"
            placeholder="请填写"
            clearable
          ></el-input>
        </el-form-item>
        <el-form-item label="岗位(选填)">
          <el-input
            v-model="contacts.contactPost"
            placeholder="请填写"
            clearable
          ></el-input>
        </el-form-item>
        <el-form-item label="手机号码(必填)" required>
          <el-input
            v-model="contacts.contactPhone"
            placeholder="请填写"
            maxlength="11"
            disabled
          ></el-input>
        </el-form-item>
        <el-form-item label="固定电话(选填)">
          <el-input
            v-model="contacts.contactTel"
            placeholder="请填写"
            clearable
          ></el-input>
        </el-form-item>
        <el-form-item label="电子邮箱(选填)">
          <el-input
            v-model="contacts.contactEmail"
            placeholder="请填写"
            clearable
          ></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button
          @click="
            contactsDialog = false;
            editLoading = false;
          "
          >取 消</el-button
        >
        <el-button type="primary" :loading="editLoading" @click="saveContacts"
          >确 定</el-button
        >
      </div>
    </el-dialog>
    <!--添加邮寄地址-->
    <el-dialog
      title="添加邮寄地址信息"
      :visible.sync="addressDialog"
      :close-on-click-modal="false"
      :show-close="false"
      center
      width="600px"
    >
      <el-form :model="addAddressInfo">
        <el-form-item label="收件人(必填)" required>
          <el-input
            v-model="addAddressInfo.fullName"
            placeholder="请填写"
            clearable
          ></el-input>
        </el-form-item>
        <el-form-item label="手机号码(必填)" required>
          <el-input
            v-model="addAddressInfo.phone"
            placeholder="请填写"
            maxlength="11"
            clearable
          ></el-input>
        </el-form-item>
        <div class="address">
          <el-form-item label="省市区(必填)" required>
            <el-cascader
              v-model="mailAddress"
              :options="addressList"
              @change="cityChange"
            ></el-cascader>
          </el-form-item>
          <el-form-item label="详细地址(必填)" required>
            <el-input
              v-model="mailAddressDetail"
              placeholder="在这里输入详细地址"
              clearable
            ></el-input>
          </el-form-item>
        </div>
        <el-form-item>
          <el-checkbox v-model="isDefault">设为默认收件地址</el-checkbox>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button
          @click="
            addressDialog = false;
            editLoading = false;
          "
          >取 消</el-button
        >
        <el-button type="primary" :loading="editLoading" @click="saveNewAddress"
          >确 定</el-button
        >
      </div>
    </el-dialog>
    <!--修改邮寄地址-->
    <el-dialog
      title="修改邮寄地址信息"
      :visible.sync="editAddressDialog"
      :close-on-click-modal="false"
      :show-close="false"
      center
      width="600px"
    >
      <el-form :model="editAddressObj">
        <el-form-item label="收件人(必填)" required>
          <el-input
            v-model="editAddressObj.fullName"
            placeholder="请填写"
            clearable
          ></el-input>
        </el-form-item>
        <el-form-item label="手机号码(必填)" required>
          <el-input
            v-model="editAddressObj.phone"
            placeholder="请填写"
            maxlength="11"
            clearable
          ></el-input>
        </el-form-item>
        <div class="address">
          <el-form-item label="省市区(必填)" required>
            <el-cascader
              v-model="mailAddress"
              :options="addressList"
              @change="cityChange"
            ></el-cascader>
          </el-form-item>
          <el-form-item label="详细地址(必填)" required>
            <el-input
              v-model="mailAddressDetail"
              placeholder="在这里输入详细地址"
              clearable
            ></el-input>
          </el-form-item>
        </div>
        <el-form-item>
          <el-checkbox v-model="isDefault">设为默认收件地址</el-checkbox>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button
          @click="
            editAddressDialog = false;
            editLoading = false;
          "
          >取 消</el-button
        >
        <el-button type="primary" :loading="editLoading" @click="saveAddress"
          >确 定</el-button
        >
      </div>
    </el-dialog>
    <!--变更号码-->
    <el-dialog
      title="变更号码"
      :visible.sync="phoneDialog"
      :close-on-click-modal="false"
      :show-close="false"
      center
      width="600px"
    >
      <div class="public">
        <el-form :model="phoneChange">
          <el-form-item label="手机号(必填)" required>
            <el-input
              v-model="phoneChange.newPhone"
              placeholder="请填写新手机号码"
              maxlength="11"
              clearable
            ></el-input>
          </el-form-item>
          <el-form-item label="验证码(必填)" required>
            <el-input
              v-model="phoneChange.smsCode"
              placeholder="请填写"
              clearable
            ></el-input>
            <span class="getCode" @click="getCode()">{{ btnValue }}</span>
          </el-form-item>
        </el-form>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button
          @click="
            phoneDialog = false;
            phoneLoading = false;
          "
          >取 消</el-button
        >
        <el-button type="primary" :loading="phoneLoading" @click="savePhone"
          >确 定</el-button
        >
      </div>
    </el-dialog>
    <!--变更密码-->
    <el-dialog
      title="修改密码"
      :visible.sync="passwordDialog"
      :close-on-click-modal="false"
      :show-close="false"
      center
      width="600px"
    >
      <el-form :model="passwordChange">
        <el-form-item label="原密码(必填)" required>
          <el-input
            v-model="passwordChange.password"
            placeholder="请填写"
            clearable
          ></el-input>
        </el-form-item>
        <el-form-item label="新密码(必填)" required>
          <el-input
            v-model="passwordChange.newPassword"
            placeholder="请填写"
            clearable
          ></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button
          @click="
            passwordDialog = false;
            cpLoading = false;
          "
          >取 消</el-button
        >
        <el-button type="primary" :loading="cpLoading" @click="changPasswordFun"
          >确 定</el-button
        >
      </div>
    </el-dialog>
    <!--支出申请-->
    <el-dialog
      :title="dialogTitle"
      :visible.sync="dialogFormVisible"
      :close-on-click-modal="false"
      :show-close="false"
      center
    >
      <el-form>
        <el-form-item label="金额" required>
          <el-input
            placeholder="输入金额"
            class="search"
            v-model.trim="amount"
          ></el-input>
        </el-form-item>
        <el-form-item label="备注(选填)">
          <el-input
            placeholder="输入备注"
            class="search"
            v-model.trim="remarks"
          ></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button
          @click="
            dialogFormVisible = false;
            payLoading = false;
          "
          >取 消</el-button
        >
        <el-button type="primary" :loading="payLoading" @click="comfirm()"
          >确 定</el-button
        >
      </div>
    </el-dialog>
  </div>
</template>

<script>
import base from "@/assets/js/base";
import { requestApiPost, requestApiFilePost } from "../api/api";
import { reqRep } from "../report/reqReport";
import { resRep } from "../report/resReport";
import addressList from "@/assets/js/address";

const Stream= require('streamjs');


export default {
  name: "accountSetting",
  data() {
    return {
      amount: "",
      remarks: "",
      cpLoading: false,
      editLoading: false,
      phoneLoading: false,
      payLoading: false,
      dialogTitle: "支出申请",
      isPlatformManager: false, //平台管理员
      dialogFormVisible: false,
      formLabelWidth: "",
      srcList: [],
      isAdd: false,
      info: {}, //基础信息
      infoChecks:[],
      retirement:false,
      medical:false,
      fund:false,
      wages:false,
      infoCheck:{
        settingId:0,
        checkRetirement:false,
        retirementBase:"0.00",
        companyRetirementRate:"0.00",
        personRetirementRate:"0.00",
        companyUnemploymentRate:"0.00",
        personUnemploymentRate:"0.00",
        companyNdustrialInjuryRate:"0.00",
        companyDisabilityBenefitsRate:"0.00",
        checkMedical:false,
        medicalBase:"0.00",
        companyMedicalRate:"0.00",
        personMedicalRate:"0.00",
        checkFund:false,
        fundBase:"0.00",
        companyFundRate:"0.00",
        personFundRate:"0.00",
        checkWages:false,
        wages:"0.00",
        checkContract:false
      },//基础信息缴纳项
      invoice: {}, //发票信息
      contact: {}, //联系人信息
      addressInfo: [], //邮寄地址信息
      safeBindPhone: "", //绑定手机
      accountAmount: "", //账户余额
      imgSrc: "",
      updateDialog: false,
      isShow: false,
      infoDialog: false,
      invoiceDialog: false,
      contactsDialog: false,
      addressDialog: false,
      phoneDialog: false,
      passwordDialog: false,
      editAddressDialog: false,
      btnValue: "获取",
      editType: 0,
      searchContent: "",
      editAccount: {},
      editInvoice: {},
      contacts: {},
      addAddressInfo: {}, //新增邮寄地址
      editAddressObj: {},
      phoneChange: {
        password: "",
        newPhone: "",
        smsCode: "",
      },
      passwordChange: {
        password: "",
        newPassword: "",
      },
      menu: [
        { title: "签约设置" },
        { title: "发票信息" },
        { title: "联系人" },
        { title: "邮寄地址" },
        { title: "安全设置" },
        // { title: "余额管理" },
      ],
      registerAddress: [], //省市区
      registAddress: "", //详细地址
      mailAddress: [],
      mailAddressDetail: "", //邮寄地址详情
      addressList: [],
      isDefault: true,
      isApply: true,
      imgLoading: false,
    };
  },
  methods: {
    changeCompanySettingDiv(e){
      for(var s=0;s<this.infoChecks.length;s++){
        if(this.infoChecks[s]===e){
          return true;
        }
      }
      return false;
    },
    changeCompanySetting(e){
      console.log("1:"+e);
      for(var check in e){
        if(check==="checkRetirement"){
          this.retirement=!this.retirement;
        }
        if(check==="checkMedical"){
          this.medical=!this.medical;
        }
        if(check==="checkFund"){
          this.fund=!this.fund;
        }
        if(check==="checkWages"){
          this.wages=!this.wages;
        }
      }
    },
    expenditureApply() {
      this.amount = "";
      this.remarks = "";
      this.dialogTitle = "支出申请";
      this.dialogFormVisible = true;
    },
    comfirm() {
      if (!this.amount || this.amount <= 0) {
        this.$message.warning("请输入正确的金额");
        return;
      }
      this.expenditureApplyRequest();
    },
    expenditureApplyRequest() {
      var reqData = {
        amount: this.amount,
        remarks: this.remarks,
        accountId: JSON.parse(sessionStorage.getItem("login")).accountId,
      };
      this.payLoading = true;
      let reqReport = reqRep({ traCode: "_PAY_APPLY_ACC", data: reqData });
      requestApiPost(reqReport).then((data) => {
        let resReport = resRep(data);
        if (resReport.getReCode() != "0000") {
          this.$message({
            message: resReport.getReMsg(),
            type: "error",
          });
          this.payLoading = false;
        } else {
          this.$message({
            message: resReport.getReMsg(),
            type: "success",
          });
          this.dialogFormVisible = false;
          this.payLoading = false;
        }
      });
    },
    //获取城市code
    cityChange(e) {
      this.areaFullName = e[0] + e[1];
      for (let i = 0; i < this.addressList.length; i++) {
        if (this.addressList[i].value == e[0]) {
          for (let j = 0; j < this.addressList[i].children.length; j++) {
            if (this.addressList[i].children[j].value == e[1]) {
              this.areaCode = this.addressList[i].children[j].areaCode;
            }
          }
        }
      }
    },
    //添加邮寄地址信息
    addAddress() {
      this.$set(this.addAddressInfo, "fullName", "");
      this.$set(this.addAddressInfo, "phone", "");
      this.mailAddress = [];
      this.mailAddressDetail = "";
      this.addressDialog = true;
    },
    //上传营业执照
    upImg(e) {
      let that = this;
      if (e.target.files[0].size > 4194304) {
        this.$message.warning("图片大小必须小于4M");
        return;
      }
      this.imgLoading = true;
      requestApiFilePost(e.target.files[0]).then((data) => {
        e.target.value = "";
        let resReport = resRep(data);
        this.imgLoading = false;
        if (resReport.getReCode() != "0000") {
          this.$message({
            message: resReport.getReMsg(),
            type: "error",
          });
        } else {
          that.updateDialog = false;
          that.$message.success("上传成功");
          that.$set(
            that.editAccount,
            "businessImagePath",
            resReport.data.filePath
          );
          that.$set(that.editAccount, "businessImageId", resReport.data.fileId);
          that.srcList = [resReport.data.filePath];
        }
      });
    },
    //修改密码
    changePassword() {
      this.$set(this.passwordChange, "password", "");
      this.$set(this.passwordChange, "newPassword", "");
      this.passwordDialog = true;
    },
    changPasswordFun() {
      if (!this.passwordChange.password || !this.passwordChange.newPassword) {
        this.$message.warning("信息不完整");
        return;
      }
      var reqData = {
        userId: JSON.parse(sessionStorage.getItem("login")).userId,
        oldPassword: this.passwordChange.password,
        newPassword: this.passwordChange.newPassword,
      };
      this.cpLoading = true;
      let reqReport = reqRep({ traCode: "_EDIT_PASSWORD", data: reqData });
      requestApiPost(reqReport).then((data) => {
        let resReport = resRep(data);
        if (resReport.getReCode() != "0000") {
          this.$message({
            message: resReport.getReMsg(),
            type: "error",
          });
          this.cpLoading = false;
        } else {
          this.$message({
            message: "修改成功",
            type: "success",
          });
          this.passwordDialog = false;
          this.cpLoading = false;
        }
      });
    },
    getCode() {
      if (!this.phoneChange.newPhone) {
        this.$message.warning("请填写手机号");
        return;
      }
      if (this.btnValue == "获取" || this.btnValue == "重发") {
        this.getCodeRequest();
        this.btnValue = 60;
        var setTime = setInterval(() => {
          if (this.btnValue > 0) {
            this.btnValue--;
          } else {
            this.btnValue = "重发";
            clearInterval(setTime);
          }
        }, 1000);
      }
    },
    //获取验证码短信验证码
    getCodeRequest() {
      if (!base.isPoneAvailable(this.phoneChange.newPhone)) {
        this.$message.warning("手机号格式不正确");
        return;
      }
      let data = { phone: this.phoneChange.newPhone };
    },

    //修改账户主体
    saveAccount() {
      if (
        !this.registAddress ||
        !this.editAccount.businessNo ||
        this.registerAddress.length <= 0
      ) {
        this.$message.warning("信息不完整");
        return;
      }
      this.updateData();
    },
    //修改发票
    saveInvoice() {
      if (!this.editInvoice.billingRise || !this.editInvoice.taxpayerNo) {
        this.$message.warning("信息不完整");
        return;
      }
      this.updateData();
    },
    //修改联系人
    saveContacts() {
      if (!this.contacts.contactName || !this.contacts.contactPhone) {
        this.$message.warning("信息不完整");
        return;
      }
      this.updateData();
    },
    //保存新地址
    saveNewAddress() {
      if (
        !this.addAddressInfo.fullName ||
        !this.addAddressInfo.phone ||
        this.mailAddress.length != 3 ||
        !this.mailAddressDetail
      ) {
        this.$message.warning("信息不完整");
        return;
      }
      this.addAddressInfo.isDefault = this.isDefault ? 1 : 0;
      this.addAddressInfo.areaFullName = this.areaFullName;
      this.addAddressInfo.areaCode = this.areaCode;
      this.addAddressInfo.address =
        JSON.stringify(this.mailAddress) + "|" + this.mailAddressDetail;
      this.updateData();
    },
    //编辑单个邮寄地址
    saveAddress() {
      if (
        !this.editAddressObj.fullName ||
        !this.editAddressObj.phone ||
        !this.mailAddressDetail ||
        this.mailAddress.length <= 0
      ) {
        this.$message.warning("信息不完整");
        return;
      }
      this.editAddressObj.areaFullName = this.areaFullName;
      this.editAddressObj.areaCode = this.areaCode;
      this.editAddressObj.isDefault = this.isDefault ? 1 : 0;
      this.editAddressObj.address =
        JSON.stringify(this.mailAddress) + "|" + this.mailAddressDetail;
      this.updateData();
    },
    //变更号码
    changePhone() {
      this.phoneDialog = true;
    },
    //编辑地址
    editAddress(i) {
      this.editAddressObj = JSON.parse(JSON.stringify(this.addressInfo[i]));
      this.areaFullName = this.editAddressObj.areaFullName;
      this.areaCode = this.editAddressObj.areaCode;
      this.isDefault = this.editAddressObj.isDefault == 1 ? true : false;
      this.mailAddress = JSON.parse(this.editAddressObj.address.split("|")[0]);
      this.mailAddressDetail = this.editAddressObj.address.split("|")[1];
      this.editAddressDialog = true;
    },
    //删除地址
    remove(id) {
      this.$confirm("您确定删除此地址?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.deleteAddress(id);
        })
        .catch(() => {});
    },
    //删除地址函数
    deleteAddress(id) {
      var reqData = {
        mailIds: id.toString(),
      };
      let reqReport = reqRep({ traCode: "_DEL_MAIL", data: reqData });
      requestApiPost(reqReport).then((data) => {
        let resReport = resRep(data);
        if (resReport.getReCode() != "0000") {
          this.$message({
            message: resReport.getReMsg(),
            type: "error",
          });
        } else {
          this.$message({
            message: "删除成功",
            type: "success",
          });
          this.getData();
        }
      });
    },
    //修改手机号
    savePhone() {
      if (!this.phoneChange.newPhone || !this.phoneChange.smsCode) {
        this.$message.warning("信息不完整");
        return;
      }
      var reqData = {
        phone: this.phoneChange.newPhone,
      };
      this.phoneLoading = true;
      let reqReport = reqRep({
        traCode: "_SAFE_PHONE_SEND_USER",
        data: reqData,
      });
      requestApiPost(reqReport).then((data) => {
        let resReport = resRep(data);
        if (resReport.getReCode() != "0000") {
          this.$message({
            message: resReport.getReMsg(),
            type: "error",
          });
          this.phoneLoading = false;
        } else {
          this.savePhoneVerify(resReport.data.phoneRand);
        }
      });
    },
    //修改安全手机校验
    savePhoneVerify(phoneRand) {
      var reqData = {
        phoneRand: phoneRand,
        rand: this.phoneChange.smsCode,
      };
      let reqReport = reqRep({
        traCode: "_SAFE_PHONE_CHECK_USER",
        data: reqData,
      });
      requestApiPost(reqReport).then((data) => {
        let resReport = resRep(data);
        if (resReport.getReCode() != "0000") {
          this.$message({
            message: resReport.getReMsg(),
            type: "error",
          });
          this.phoneLoading = false;
        } else {
          this.phoneDialog = false;
          this.phoneLoading = false;
          this.$message({
            message: "修改成功",
            type: "success",
          });
          this.getData();
        }
      });
    },
    invoiceClose() {
      this.invoiceDialog = false;
    },
    switchFun(i) {
      this.editType = i;
    },
    upimgFun() {
      this.updateDialog = true;
    },
    //获取用户信息
    getData() {
      var reqData = {
        companyId: JSON.parse(sessionStorage.getItem("login")).personId,
        personId: "",
      };
      // let reqReport = reqRep({ traCode: "_INFO_USER", data: reqData });
      let reqReport = reqRep({ traCode: "_INFO_USER_1", data: reqData });
      requestApiPost(reqReport).then((data) => {
        let resReport = resRep(data);
        if (resReport.getReCode() != "0000") {
          this.$message({
            message: resReport.getReMsg(),
            type: "error",
          });
        } else {
          this.info = resReport.data.account;
          this.srcList = [resReport.data.account.businessImagePath];
          this.invoice = resReport.data.invoice;
          this.contact = resReport.data.contact;
          this.addressInfo = resReport.data.address;
          this.accountAmount = resReport.data.accountAmount;
          this.safeBindPhone = resReport.data.safeBindPhone;
          this.infoCheck.settingId=this.info.settingId;
          this.infoCheck.checkRetirement=this.info.checkRetirement===1;
          this.infoCheck.retirementBase=this.info.retirementBase;
          this.infoCheck.companyRetirementRate=this.info.companyRetirementRate;
          this.infoCheck.personRetirementRate=this.info.personRetirementRate;
          this.infoCheck.companyUnemploymentRate=this.info.companyUnemploymentRate;
          this.infoCheck.personUnemploymentRate=this.info.personUnemploymentRate;
          this.infoCheck.companyNdustrialInjuryRate=this.info.companyNdustrialInjuryRate;
          this.infoCheck.companyDisabilityBenefitsRate=this.info.companyDisabilityBenefitsRate;
          this.infoCheck.checkMedical=this.info.checkMedical===1;
          this.infoCheck.medicalBase=this.info.medicalBase;
          this.infoCheck.companyMedicalRate=this.info.companyMedicalRate;
          this.infoCheck.personMedicalRate=this.info.personMedicalRate;
          this.infoCheck.checkFund=this.info.checkFund===1;
          this.infoCheck.fundBase=this.info.fundBase;
          this.infoCheck.companyFundRate=this.info.companyFundRate;
          this.infoCheck.personFundRate=this.info.personFundRate;
          this.infoCheck.checkWages=this.info.checkWages===1;
          this.infoCheck.wages=this.info.wages;
          this.infoCheck.checkContract=this.info.checkContract===1;
          this.infoChecks=[
            this.infoCheck.checkRetirement?"checkRetirement":"",
            this.infoCheck.checkMedical?"checkMedical":"",
            this.infoCheck.checkFund?"checkFund":"",
            this.infoCheck.checkWages?"checkWages":"",
            this.infoCheck.checkContract?"checkContract":""
          ];
          console.log(this.infoChecks)
        }
      });
    },
    //修改用户信息
    updateData() {
      if (this.editType == 0) {
        this.editAccount.address =
          JSON.stringify(this.registerAddress) + "|" + this.registAddress;
        // if (!this.editAccount.businessImageId) {
        //   this.$message.warning("请上传营业执照图片");
        //   return;
        // }
      }
      var reqData = {
        settingId: this.infoCheck.settingId,
        companyId: JSON.parse(sessionStorage.getItem("login")).personId,
        editType: this.editType, //修改内容 0基础信息；1发票信息；2联系人信息；3邮寄地址
        account: this.editAccount,
        invoice: this.editInvoice,
        contact: this.contacts,
        checkRetirement:this.infoChecks.includes("checkRetirement")?1:0,
        retirementBase:this.infoCheck.retirementBase,
        companyRetirementRate:this.infoCheck.companyRetirementRate,
        personRetirementRate:this.infoCheck.personRetirementRate,
        companyUnemploymentRate:this.infoCheck.companyUnemploymentRate,
        personUnemploymentRate:this.infoCheck.personUnemploymentRate,
        companyNdustrialInjuryRate:this.infoCheck.companyNdustrialInjuryRate,
        companyDisabilityBenefitsRate:this.infoCheck.companyDisabilityBenefitsRate,
        checkMedical:this.infoChecks.includes("checkMedical")?1:0,
        medicalBase:this.infoCheck.medicalBase,
        companyMedicalRate:this.infoCheck.companyMedicalRate,
        personMedicalRate:this.infoCheck.personMedicalRate,
        checkFund:this.infoChecks.includes("checkFund")?1:0,
        fundBase:this.infoCheck.fundBase,
        companyFundRate:this.infoCheck.companyFundRate,
        personFundRate:this.infoCheck.personFundRate,
        checkWages:this.infoChecks.includes("checkWages")?1:0,
        wages:this.infoCheck.wages,
        checkContract:this.infoChecks.includes("checkContract")?1:0,
        address: this.editAddressDialog
          ? this.editAddressObj
          : this.addAddressInfo,
      };
      this.editLoading = true;
      let reqReport = reqRep({ traCode: "_EDIT_USER_1", data: reqData });
      requestApiPost(reqReport).then((data) => {
        let resReport = resRep(data);
        if (resReport.getReCode() != "0000") {
          this.$message({
            message: resReport.getReMsg(),
            type: "error",
          });
          this.editLoading = false;
        } else {
          this.$message({
            message: "修改成功",
            type: "success",
          });
          this.infoDialog = false;
          this.invoiceDialog = false;
          this.contactsDialog = false;
          this.editAddressDialog = false;
          this.addressDialog = false;
          this.editLoading = false;
          this.editInvoice = {};
          this.addAddressInfo = {};
          this.editAddressObj = {};
          this.getData();
        }
      });
    },
    //编辑账户
    editAccountFun() {
      this.editAccount = JSON.parse(JSON.stringify(this.info));
      if (this.editAccount.address) {
        this.registerAddress = JSON.parse(
          this.editAccount.address.split("|")[0]
        );
        this.registAddress = this.editAccount.address.split("|")[1];
      }

      this.infoDialog = true;
    },
    editInvoiceBtn() {
      this.editInvoice = JSON.parse(JSON.stringify(this.invoice));
      this.$set(this.editInvoice, "invoiceType", 1);
      this.$set(this.editInvoice, "invoiceTypeId", 1);
      this.invoiceDialog = true;
    },
    editContact() {
      this.contacts = JSON.parse(JSON.stringify(this.contact));
      this.contactsDialog = true;
    },
  },
  filters: {
    //过滤器
    addressFilter(e) {
      if (e) {
        return (
          JSON.parse(e.split("|")[0]).toString().replace(/,/g, "") +
          " " +
          e.split("|")[1]
        );
      } else {
        return "-";
      }
    },
  },
  created() {
    if (
      JSON.parse(sessionStorage.getItem("login")).userType == "3" ||
      JSON.parse(sessionStorage.getItem("login")).userType == "0"
    ) {
      this.isPlatformManager = true;
    } else {
      this.isPlatformManager = false;
    }
    if (
      JSON.parse(sessionStorage.getItem("login")).userType == "1" ||
      JSON.parse(sessionStorage.getItem("login")).userType == "2"
    ) {
      this.isApply = true;
    } else {
      this.isApply = false;
    }
    this.getData();
    this.addressList = addressList;
  },
};
</script>
<style scoped>
.header {
  padding: 15px;
  height: 50px;
  box-sizing: border-box;
  font-size: 14px;
  border-bottom: 1px solid #eee;
}
.header i {
  margin-right: 5px;
}
.menu-swtich {
  height: 50px;
  line-height: 50px;
  border-bottom: 1px solid #eee;
}
.menu-swtich li {
  display: inline-block;
  padding: 0 15px;
  cursor: pointer;
}
.active {
  color: #13cb6e;
  border-bottom: 2px solid #13cb6e;
}
.content {
  padding: 20px;
}
.content-header {
  color: #333;
  font-size: 16px;
}
.content-header .title {
  display: inline-block;
}
.edit {
  float: right;
  font-size: 14px;
  color: #666;
  cursor: pointer;
}
.main-content {
  margin-top: 15px;
}
.main-content section {
  line-height: 28px;
  font-size: 14px;
}
.main-content section span {
  display: inline-block;
}
.main-content .st {
  width: 140px;
  color: #666;
  padding-right: 10px;
}
.up-img {
  margin-top: 10px;
  width: 110px;
  text-align: center;
  cursor: pointer;
  display: inline-block;
  color: #ccc;
  height: 130px;
  line-height: 130px;
  border-radius: 4px;
  background-color: #eee;
}
.up-img img {
  display: inline-block;
  width: 110px;
  height: 130px;
  border-radius: 4px;
}
.retransmission {
  margin-top: 20px;
  color: #666;
  width: 110px;
  cursor: pointer;
  text-align: center;
}

.address-list {
  margin-bottom: 20px;
}
.address-list ul {
  display: inline-block;
  width: 500px;
  margin-right: 20px;
}
.address-list ul li {
  color: #999;
  font-size: 14px;
}
.address-list ul div {
  display: inline-block;
  margin-right: 20px;
  color: #666;
  font-size: 16px;
}
.address-list .isDefault {
  margin-left: 8px;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 3px;
  background: #13cb6e;
  color: #fff;
}
.address-list ul li {
  margin-bottom: 5px;
}
.address-edit {
  display: inline-block;
  font-size: 14px;
  color: #999;
  margin-right: 20px;
  cursor: pointer;
}
.address-edit:hover {
  color: #13cb6e;
}
.bind {
  color: #666;
  cursor: pointer;
}
.bind:hover {
  color: #13cb6e;
}
.el-form-item {
  width: 260px;
  margin: 0 auto;
}
.public .el-form-item {
  width: 380px;
  margin: 0 auto 10px;
}
.el-form-item p {
  height: 40px;
  line-height: 40px;
}
.el-form-item .up-img {
  margin-top: 0 !important;
}
.widthChage {
  width: 338px;
}
h4 {
  width: 260px;
  margin: 0 auto 22px;
}
.el-input,
.el-select,
.el-cascader {
  margin-bottom: 2px;
}

.tip {
  width: 260px;
  text-align: center;
  background: #ccc;
  padding: 5px 10px;
  margin: 10px auto;
  cursor: pointer;
}

.getCode {
  display: inline-block;
  text-align: center;
  padding: 0 10px;
  height: 40px;
  font-size: 12px;
  line-height: 40px;
  border-radius: 4px;
  background: #13cb6e;
  color: #fff;
  cursor: pointer;
}
.message {
  color: #666;
  text-align: center;
}
.img-head {
  position: relative;
  top: 10px;
  text-align: center;
  left: 50%;
  margin-left: -54px;
  width: 108px;
  height: 135px;
  cursor: pointer;
  background-color: #eee;
}
.img-head i,
.img-bj i {
  position: absolute;
  top: 50%;
  left: 50%;
  color: #999;
  font-size: 20px;
  margin-top: -10px;
  margin-left: -10px;
}
.img-head input {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  height: 100%;
  width: 100%;
  cursor: pointer;
}
.nodata {
  font-size: 14px;
  color: #999;
}
.sign {
  font-size: 12px;
  margin-right: 2px;
}
</style>
